﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.postgresql
{
	// Token: 0x02000123 RID: 291
	public class TForEachStmt : TBlockSqlStatement
	{
		// Token: 0x06000956 RID: 2390 RVA: 0x00303396 File Offset: 0x00301596
		public void setSliceValue(TConstant c)
		{
			this.sliceValue = c;
		}

		// Token: 0x06000957 RID: 2391 RVA: 0x0030339F File Offset: 0x0030159F
		public void setArrayExpr(TExpression e)
		{
			this.arrayExpr = e;
		}

		// Token: 0x06000958 RID: 2392 RVA: 0x003033A8 File Offset: 0x003015A8
		public TForEachStmt() : this(EDbVendor.dbvpostgresql)
		{
		}

		// Token: 0x170001A1 RID: 417
		// (get) Token: 0x0600095A RID: 2394 RVA: 0x003033BB File Offset: 0x003015BB
		// (set) Token: 0x06000959 RID: 2393 RVA: 0x003033B2 File Offset: 0x003015B2
		public virtual TConstant SliceValue
		{
			get
			{
				return this.sliceValue;
			}
			set
			{
				this.sliceValue = value;
			}
		}

		// Token: 0x170001A2 RID: 418
		// (get) Token: 0x0600095C RID: 2396 RVA: 0x003033CC File Offset: 0x003015CC
		// (set) Token: 0x0600095B RID: 2395 RVA: 0x003033C3 File Offset: 0x003015C3
		public virtual TExpression ArrayExpr
		{
			get
			{
				return this.arrayExpr;
			}
			set
			{
				this.arrayExpr = value;
			}
		}

		// Token: 0x0600095D RID: 2397 RVA: 0x003033D4 File Offset: 0x003015D4
		public TForEachStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstpostgresqlforeach;
		}

		// Token: 0x0600095E RID: 2398 RVA: 0x003033E8 File Offset: 0x003015E8
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			base.doParseStatement(psql);
			this.stmts.doParse(this, ESqlClause.unknown);
			for (int i = 0; i < this.stmts.size(); i++)
			{
				this.BodyStatements.add(this.stmts.getStatementSqlNode(i).Stmt);
			}
			return 0;
		}

		// Token: 0x170001A3 RID: 419
		// (get) Token: 0x0600095F RID: 2399 RVA: 0x0030343D File Offset: 0x0030163D
		public virtual TStatementListSqlNode Stmts
		{
			get
			{
				return this.stmts;
			}
		}

		// Token: 0x170001A4 RID: 420
		// (get) Token: 0x06000960 RID: 2400 RVA: 0x00303445 File Offset: 0x00301645
		// (set) Token: 0x06000961 RID: 2401 RVA: 0x0030344D File Offset: 0x0030164D
		public virtual TObjectName VariableName
		{
			get
			{
				return this.variableName;
			}
			set
			{
				this.variableName = value;
			}
		}

		// Token: 0x06000962 RID: 2402 RVA: 0x00303456 File Offset: 0x00301656
		public override void init(object arg1, object arg2)
		{
			this.stmts = (TStatementListSqlNode)arg1;
			this.variableName = (TObjectName)arg2;
		}

		// Token: 0x06000963 RID: 2403 RVA: 0x00303470 File Offset: 0x00301670
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000964 RID: 2404 RVA: 0x00303480 File Offset: 0x00301680
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			this.BodyStatements.accept(v);
			v.postVisit(this);
		}

		// Token: 0x04001241 RID: 4673
		private TObjectName variableName;

		// Token: 0x04001242 RID: 4674
		private TStatementListSqlNode stmts;

		// Token: 0x04001243 RID: 4675
		private TExpression arrayExpr;

		// Token: 0x04001244 RID: 4676
		private TConstant sliceValue;
	}
}
